<!--
 * @FileDescription: 
 * @Author: wangzhichiao<https://github.com/wzc570738205>
 * @Date: 2021-11-26 09:12:11
 * @LastEditors: wangzhichiao<https://github.com/wzc570738205>
 * @LastEditTime: 2021-11-26 11:15:02
-->
<template>
  <div>
    home {{ counter }} 
    <button @click="addCount">add</button>
  </div>
</template>

<script>
import { useMainStore } from "@/store/main";
import { storeToRefs } from "pinia";
import { defineComponent, toRaw, computed } from "@vue/composition-api";

export default defineComponent({
  name: "App",
  setup() {
    const mainStore = useMainStore();
    const counter = computed(() => mainStore.getCount);

    const addCount = () => {
      mainStore.addCount();
    };
    return {
      counter,
      addCount,
    };
  },
});
</script>

<style lang="scss" scoped></style>
